package pay.service.impl;

import com.taxation.web.project.pay.module.PayOrderDO;
import com.taxation.web.project.pay.module.convent.PayOrderConvert;
import com.taxation.web.project.pay.module.order.PayOrderCreateReqDTO;
import com.taxation.web.project.pay.module.order.PayOrderRespDTO;
import com.taxation.web.project.pay.service.PayOrderApi;
import com.taxation.web.project.pay.service.PayOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 支付单 API 实现类
 *
 * @author wwy
 */
@Service
public class PayOrderApiImpl implements PayOrderApi {

    @Resource
    private PayOrderService payOrderService;

    @Override
    public String createOrder(PayOrderCreateReqDTO reqDTO) {
        return payOrderService.createPayOrder(reqDTO);
    }

    @Override
    public PayOrderRespDTO getOrder(String id) {
        PayOrderDO order = payOrderService.getOrder(id);
        return PayOrderConvert.INSTANCE.convert2(order);
    }

}
